﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Jy123.Web.Manage
{
    public partial class Password : MgConfig
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Verify("#");
            if (!IsPostBack)
            {
                txtName.Text = manage.MName;
            }
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (manage.Password != DBUtility.DESEncrypt.Md5(OldPwd.Value, true))
            {
                Message = MessageBox("旧密码错误！", MsgType.warning);
            }
            else
            {
                manage.Password = DBUtility.DESEncrypt.Md5(pwd.Value, true);
                try
                {
                    new BLL.Manage_Main().Update(manage);
                    Message = MessageBox("修改成功，下次登录请使用新密码！", MsgType.ok);
                }
                catch
                {
                    Message = MessageBox("操作失败！", MsgType.error);
                }
            }
        }
    }
}
